package com.crm.customers.dao.impl;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.crm.base.dao.BaseDao;
import com.crm.customers.dao.CustomerContactsDao;
import com.crm.customers.model.CustomerCategory;
import com.crm.customers.model.CustomerContacts;

@Repository("customerContactsDao")
public class CustomerContactsDaoImpl extends BaseDao implements CustomerContactsDao {
	
	private static final String MAPPER_NAMESPACE = "CustomerContactsMapper.";

	@Override
	public CustomerContacts insertCustomerContacts(CustomerContacts ccontacts) {
		insert(MAPPER_NAMESPACE+"insertCustomerContacts", ccontacts);
		return ccontacts;
	}

	@Override
	public CustomerContacts updateCustomerContacts(CustomerContacts ccontacts) {
		update(MAPPER_NAMESPACE+"updateCustomerContacts", ccontacts);
		return ccontacts;
		//return 
	}

	@Override
	public List<CustomerContacts> getCustomerContactsList(Long cusid) {
		List<CustomerContacts> list = selectList(MAPPER_NAMESPACE+"getCustomerContactsList", cusid);
		return list;
	}

	@Override
	public CustomerContacts getCustomerContactsByid(Long id) {
		return selectOne(MAPPER_NAMESPACE+"getCustomerContactsByid", id);
	}

	@Override
	public int getTelCount(CustomerContacts ccontacts) {
		return selectOne(MAPPER_NAMESPACE+"getTelCount", ccontacts);
	}

	@Override
	public List<CustomerContacts> getcustconlistByid(Long id) {
		return selectList(MAPPER_NAMESPACE+"getcustconlistByid", id);
	}

	@Override
	public int updateCustomerMainContacts(CustomerContacts ccontacts) {
		return update(MAPPER_NAMESPACE+"updateCustomerMainContacts", ccontacts);
	}

	@Override
	public CustomerContacts getcustconlistByphone(CustomerContacts ccontacts) {
		return selectOne(MAPPER_NAMESPACE+"getcustconlistByphone", ccontacts);
	}



}
